<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>进阶异步面试题</h2>
</body>
<script>
    (function() {
        setTimeout(()=>{
            console.log(0)
        })

      
        new Promise((resolve)=>{
            setTimeout(()=>{
                resolve();
                Promise.resolve().then(()=>console.log(2))
                console.log(3)
            })
        }).then(()=>{
            console.log(5)
            Promise.resolve().then(()=>console.log(8))
            setTimeout(()=>console.log(6))
        })
    })()

    //0,3,5,2,8,6
    //Event Loop 事件循环  宏任务和微任务
</script>
</html>